package lab03.test09;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class Test09 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();//把表单放入数组集合中
        try {
            FileReader fr = new FileReader("G://book.txt");
            BufferedReader br = new BufferedReader(fr);
            BufferedWriter fw1 = new BufferedWriter(new FileWriter("G://book1.txt"));
            String s = br.readLine();
            while(s != null)
            {
               fw1.write(s);
               fw1.newLine();
            }
            String [] string = s.split(" ");
            for (int i = 0;i< s.length();i++){
                list.add(string[i]);
            }
            //更改信息，然后输出
            for (int i = 0;i< list.size();i++){
                if (list.get(i).equals("1003")){
                    fw1.write("82.5");
                }else if(list.get(3).equals("1004")){
                    fw1.write("89.2");
                }else
                {
                    fw1.write("  ");

                }
                if (i == 5){
                    fw1.newLine();
                }
            }
            br.close();
            fw1.close();


        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
